package com.cch.examSystem.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.cch.examSystem.entity.FunGameStudent;
import com.cch.examSystem.entity.Manager;
import com.cch.examSystem.entity.StudentList;

public class FunGameStudentListServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doPost(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		Date now = new Date();
		SimpleDateFormat datetime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		SimpleDateFormat date = new SimpleDateFormat("yyyy-MM-dd");
		SimpleDateFormat time = new SimpleDateFormat("HH:mm:ss");
		response.setContentType("text/html");
		

		List userList = new ArrayList();
		FunGameStudent user;
		for (int i = 0; i < 50; i++) {
			user = new FunGameStudent("1302121212"+i,datetime.format(new Date()));
			userList.add(user);
		}
		HttpSession session = request.getSession();
		session.setAttribute("fungamestudentList", userList);

		response.sendRedirect("./manager/FunGameStudentList.jsp.jsp");

	}

}
